3.170 \(\int \frac{-10+3 x^2}{4-4 x+x^2} \, dx\)

Optimal. Leaf size=21 \[ 3 x+\frac{2}{2-x}+12 \log (2-x) \]

[Out]

2/(2 - x) + 3*x + 12*Log[2 - x]

________________________________________________________________________________________

Rubi [A]  time = 0.0132023, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {27, 697} \[ 3 x+\frac{2}{2-x}+12 \log (2-x) \]

Antiderivative was successfully verified.

[In]

Int[(-10 + 3*x^2)/(4 - 4*x + x^2),x]

[Out]

2/(2 - x) + 3*x + 12*Log[2 - x]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 697

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rubi steps

\begin{align*} \int \frac{-10+3 x^2}{4-4 x+x^2} \, dx &=\int \frac{-10+3 x^2}{(-2+x)^2} \, dx\\ &=\int \left (3+\frac{2}{(-2+x)^2}+\frac{12}{-2+x}\right ) \, dx\\ &=\frac{2}{2-x}+3 x+12 \log (2-x)\\ \end{align*}

Mathematica [A]  time = 0.009009, size = 19, normalized size = 0.9 \[ 3 (x-2)-\frac{2}{x-2}+12 \log (x-2) \]

Antiderivative was successfully verified.

[In]

Integrate[(-10 + 3*x^2)/(4 - 4*x + x^2),x]

[Out]

-2/(-2 + x) + 3*(-2 + x) + 12*Log[-2 + x]

________________________________________________________________________________________

Maple [A]  time = 0.049, size = 18, normalized size = 0.9 \begin{align*} 3\,x-2\, \left ( -2+x \right ) ^{-1}+12\,\ln \left ( -2+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*x^2-10)/(x^2-4*x+4),x)

[Out]

3*x-2/(-2+x)+12*ln(-2+x)

________________________________________________________________________________________

Maxima [A]  time = 1.01219, size = 23, normalized size = 1.1 \begin{align*} 3 \, x - \frac{2}{x - 2} + 12 \, \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^2-10)/(x^2-4*x+4),x, algorithm="maxima")

[Out]

3*x - 2/(x - 2) + 12*log(x - 2)

________________________________________________________________________________________

Fricas [A]  time = 1.67132, size = 69, normalized size = 3.29 \begin{align*} \frac{3 \, x^{2} + 12 \,{\left (x - 2\right )} \log \left (x - 2\right ) - 6 \, x - 2}{x - 2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^2-10)/(x^2-4*x+4),x, algorithm="fricas")

[Out]

(3*x^2 + 12*(x - 2)*log(x - 2) - 6*x - 2)/(x - 2)

________________________________________________________________________________________

Sympy [A]  time = 0.081477, size = 14, normalized size = 0.67 \begin{align*} 3 x + 12 \log{\left (x - 2 \right )} - \frac{2}{x - 2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x**2-10)/(x**2-4*x+4),x)

[Out]

3*x + 12*log(x - 2) - 2/(x - 2)

________________________________________________________________________________________

Giac [A]  time = 1.2725, size = 24, normalized size = 1.14 \begin{align*} 3 \, x - \frac{2}{x - 2} + 12 \, \log \left ({\left | x - 2 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^2-10)/(x^2-4*x+4),x, algorithm="giac")

[Out]

3*x - 2/(x - 2) + 12*log(abs(x - 2))